import { Application } from "kilom/lib/Application";
import { ServerMain } from "../ServerMain";
import { singleton } from "../../common/util";

/**
 * Gate服务器
 */
export const gateMain = _ as GateMain;
export class GateMain extends ServerMain {

    /** 对应服务器在线人数 */
    sidOnlines: { [sid: number]: number } = {}

    init() {
        (gateMain as any) = this;
    }

    /**
     * 获取某个服的在线人数
     * @param sid 
     */
    getSidOnlines(sid: number) {
        return this.sidOnlines[sid] || 0;
    }

}